public class Demo4 {

    public static void main(String[] args) throws InterruptedException {

        Thread t = new Thread(() -> {
            while (true) {
                System.out.println("Hello: " + Thread.currentThread().getId());
                System.out.println("Hello: " + Thread.currentThread().getName());
                System.out.println("Hello: " + Thread.currentThread().getState());
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });

        t.start();

        while (true) {
            System.out.println("Hello: " + Thread.currentThread().getId());
            System.out.println("Hello: " + Thread.currentThread().getName());
            System.out.println("Hello: " + Thread.currentThread().getState());

            Thread.sleep(3000);
            break;
        }
        System.out.println("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
    }
}
